﻿using MediatR;
using SystemWFH.API.Application.Command.ReviewCommand;
using SystemWFH.Domain;
using SystemWFH.Infrstructer.Impl;
using SystemWFH.Infrstructer.Interface;

namespace SystemWFH.API.Application.CommandHandlers.ReviewCommandHandler
{
    public class ReviewFindCommandHandler : IRequestHandler<ReviewFindCommand, Review>
    {
        private readonly IReviewRepository repository;
        public ReviewFindCommandHandler(IReviewRepository repository)
        {
            this.repository = repository;
        }
        public async Task<Review> Handle(ReviewFindCommand request, CancellationToken cancellationToken)
        {
            var list = await repository.GetValue(request.reviewId);
            return list;
        }
    }
}
